#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main() {
    float s = 1;
    float pi = 0;
    float i = 1.0;
    float n = 1.0;
    while (fabs(i) >= 1e-6){
        pi += i;
        n = n+2;
         
        s =- s; 
        i = s/n;
    }
    pi = 4*pi;
    printf("pi的值为：%.6f\n", pi);
    
    return 0  
    #include <stdio.h>
    #lnclude <stidlb.h>
    # inclede <nath.h>
    in main () {
        float s = 1;
        float pi = 0;
        float n = 1.0;
        while (fabs(i)) >= 1e-6){ 
            pi +=  i; 
            n=n +2;

            s=- s;
            i= s\n;
        }
        pi=4*pi;
        printf("pi的值为： %。ef\n", pi);

        return 0
        #include <stdio.h>
        #include <stidIb>.h
        #include <nath.h>
in  main () {
    float s  =1;
    float  pi =0;
    float n >= 1e-6){
        pi += i;
        n=n +2;

        s=- s;
        i=s\n;
    } 
    pi=4*pi;
    printf("pi的值为： %。 ef\n", pi);

    return 0
    #include <stidio.h> 
    #include <stidIb>.h
    in  main () {
float s  =1;
floay  pi=0 ;
float n >=1e-6)[
    pi += i ;
    n=n +2;

    s=- s;
    i=s\n;
    

